<?php

namespace app\api\validate;

use think\Validate;

/**
 * 周日报
 */
class WorkValidate extends Validate
{

//$basedata = [
//'admin_id' => $admin_id,
//'works' => $param['works'],
//'type' => $param['type'],
//'type_user' => $param['uids'],
//'plans' => $param['plans'],
//'remark' => $param['remark'],
//'create_time' => time(),
//];

    protected $rule = [
        'is_this' => 'require|in:1,2',
        'id' => 'require',
        'works' => 'require',
        'type' => 'require|in:1,2,3',
        'type_user' => 'require',
        'plans' => 'require',
        'remark' => 'require',
    ];

    protected $message = [
        'is_this.require' => '是否发接类型不能为空',
        'is_this.in' => '是否发接类型错误',
        'id.require' => '信息未找到',
        'works.require' => '汇报工作内容不能为空',
        'type.require' => '类型：1 日报 2周报 3月报 不能为空',
        'type.in' => '类型：1 日报 2周报 3月报 不能为空',
        'plans.require' => '计划工作内容不能为空',
        'remark.require' => '其他事项不能为空',
    ];

    protected $scene = [
        'list' => ['is_this'],
        'info' => ['id'],
        'save' => ['works', 'type', 'type_user'],
    ];
}